package com.avic.rong.course.showapi;

import com.avic.rong.api.HttpPostService;
import com.example.minato.minastore.BaseApi;
import com.example.minato.minastore.listener.HttpOnNextListener;
import com.trello.rxlifecycle2.components.support.RxAppCompatActivity;

import io.reactivex.Observable;
import retrofit2.Retrofit;

/**
 * Created by TSJ-2018-0492 on 2019/8/8.
 */

public class ChannelContentApi extends BaseApi {
    private String code;
    private int pageNo;
    private int pageSize = 20;

    public void setPageNo(int pageNo) {
        this.pageNo = pageNo;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public ChannelContentApi(RxAppCompatActivity rxAppCompatActivity, HttpOnNextListener listener, String code) {
        super(rxAppCompatActivity, listener);
        this.code = code;
        setMethod("home/pingdao/" + code);
    }


    @Override
    public Observable getObservable(Retrofit retrofit) {
        HttpPostService httpPostService = retrofit.create(HttpPostService.class);
        return httpPostService.getChannelarticles(code, pageNo, pageSize);
    }
}
